/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:
 * Date: 2025-04-09
 * Time: 11:15
 */
public class demo3 {
    public static void main(String[] args) throws InterruptedException {
        Thread tc =new Thread(() -> {
            System.out.println(Thread.currentThread().getName());
        },"c");

        Thread tb = new Thread(() -> {
            try{
                tc.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName());
        },"b");

        Thread ta = new Thread(() -> {
            try{
                tb.join();
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName());
        },"a");

        ta.start();
        tb.start();
        tc.start();
    }
}

